import { useStorage } from '@vueuse/core';

import { BaseService } from './base';

export class localService extends BaseService {
  constructor(config: Record<string, any> = {}) {
    super();
    const key = config?.id || '__config__';
    this.config = useStorage(key, config);
  }

  public getConfig() {
    return this.config.value;
  }

  public saveConfig(config: any) {
    this.config.value = config;
  }
}
